/*
 * Copyright (c) Zhongkehonglue Technologies Co., Ltd. 2025. All rights reserved.
 * Description: dmc log info.
 * Author: wangchunyang
 * Create: 2025-05-23
 */

#ifndef DMC_LOG_H
#define DMC_LOG_H

#include "hilog/log_c.h"

#ifdef __cplusplus
extern "C" {
#endif
#ifndef LOG_DOMAIN_DLNA
#define LOG_DOMAIN_DLNA 0xD004601
#endif

#ifndef LOG_TAG_DLNA
#define LOG_TAG_DLNA "CAST_ENGINE_DLNA"
#endif

namespace DlnaDmc {

#define DMC_PRINT_HILOG(level, fmt, ...)                                                     \
    do {                                                                                      \
        (void)HILOG_IMPL(LOG_CORE, level, LOG_DOMAIN_DLNA, LOG_TAG_DLNA, fmt, ##__VA_ARGS__); \
    } while (0)

#define DMC_LOGE(fmt, ...) DMC_PRINT_HILOG(LOG_ERROR, fmt, ##__VA_ARGS__)
#define DMC_LOGW(fmt, ...) DMC_PRINT_HILOG(LOG_WARN, fmt, ##__VA_ARGS__)
#define DMC_LOGI(fmt, ...) DMC_PRINT_HILOG(LOG_INFO, fmt, ##__VA_ARGS__)
#define DMC_LOGD(fmt, ...) DMC_PRINT_HILOG(LOG_DEBUG, fmt, ##__VA_ARGS__)

#define LOGE(fmt, ...) \
    DMC_PRINT_HILOG(LOG_ERROR, "[DLNADMC][%{public}s][:%{public}d]-:" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)
#define LOGW(fmt, ...) \
    DMC_PRINT_HILOG(LOG_WARN, "[DLNADMC][%{public}s][:%{public}d]-:" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)
#define LOGI(fmt, ...) \
    DMC_PRINT_HILOG(LOG_INFO, "[DLNADMC][%{public}s][:%{public}d]-:" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)
#define LOGD(fmt, ...) \
    DMC_PRINT_HILOG(LOG_DEBUG, "[DLNADMC][%{public}s][:%{public}d]-:" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)

}
#ifdef __cplusplus
}
#endif

#endif
